10/01/2002
5:45 PM

 

PreviousNext
 
   
Frankentosh: Building Robots using Mac OS X
 
   
  • Mindstorms -- programming with leJOS
    • Again, let's start with a robotic "Hello World"
    • 
      import josx.platform.rcx.Motor;
      
      public class MoveForward {		
          public static void main(String[] args) {
              while (true) {
                  Motor.A.forward();
                  Motor.C.forward();
              }
          }	
      }
      
    • Motor.A & Motor.C are static variables inside of the Motor class, so we can call those directly
    • We need to have the while loop, so the main class doesn't return right away.
 
   
Ted Stevko, Stevko Studios http://www.plasticnoodle.com